package model

import (
	"fmt"
)

//声明一个Customer结构体，表示客户信息
type Customer struct {
	Id     int
	Name   string
	Gender string
	Age    int
	Tell   int
	Email  string
}

//工厂模式，返回一个customer实例
func NewCustomer(id int, name string, gender string,
	age int, tell int, email string) Customer {
	return Customer{
		Id:     id,
		Name:   name,
		Gender: gender,
		Age:    age,
		Tell:   tell,
		Email:  email,
	}
}

//不带id的customer实例
func NewCustomer2(name string, gender string,
	age int, tell int, email string) Customer {
	return Customer{
		Name:   name,
		Gender: gender,
		Age:    age,
		Tell:   tell,
		Email:  email,
	}
}

//返回用户的信息
func (this Customer) GetInfo() string {
	info := fmt.Sprintf("%v\t%v\t%v\t%v\t%v\t%v\t", this.Id, this.Name, this.Gender, this.Age, this.Tell, this.Email)
	return info
}
